package com.vichat.user.entity;

import javax.persistence.*;

/***************
 *author: autogen
 *version: 2017-11-23 12:56:37.023
 */
@Entity
@Table(name = "user_org", catalog = "userdb")
public class UserOrg implements java.io.Serializable{

	private static final long serialVersionUID = 1L;
	


    public static final String TABLE = "user_org";

    /**组织ID */
	public static final String ALIAS_ORG_ID = "org_id";
    /**组织编号 */
	public static final String ALIAS_ORG_CODE = "org_code";
    /**企业编号 */
	public static final String ALIAS_PARTY_ID = "party_id";
    /**组织名称 */
	public static final String ALIAS_ORG_NAME = "org_name";
    /**上级组织 */
	public static final String ALIAS_PARENT_ID = "parent_id";
    /**排序 */
	public static final String ALIAS_SORTNO = "sortno";
    /**是否有下级 1 是 0 否 */
	public static final String ALIAS_LEAF = "leaf";
    /**下级数量 */
	public static final String ALIAS_LEAF_NUM = "leaf_num";
    /**数据 0 无效 1 有效 */
	public static final String ALIAS_STATE = "state";
    /**创建时间 */
	public static final String ALIAS_CREATE_TIME = "create_time";
    /**修改时间 */
	public static final String ALIAS_UPDATE_TIME = "update_time";
    /**版本号 */
	public static final String ALIAS_VERSION = "version";



	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "org_id", unique = true, nullable = false)
    public Long orgId;
  
 	@Column(name = "org_code")
    public String orgCode;
  
 	@Column(name = "party_id")
    public Long partyId;
  
 	@Column(name = "org_name")
    public String orgName;
  
 	@Column(name = "parent_id")
    public Long parentId = 0l;
  
 	@Column(name = "sortno")
    public Long sortno = 0l;
  
 	@Column(name = "leaf")
    public Long leaf;
  
 	@Column(name = "leaf_num")
    public Long leafNum;
  
 	@Column(name = "state")
    public Long state = 1l;
  
 	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
    public java.util.Date createTime;
  
 	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_time")
    public java.util.Date updateTime;
  
 	@Column(name = "version")
    public Long version = 0l;
  
	@Transient
	public String userType;


	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public Long getOrgId() {
		return this.orgId;
	}
	
	public void setOrgId(Long value) {
		this.orgId = value;
	}

	public String getOrgCode() {
		return this.orgCode;
	}
	
	public void setOrgCode(String value) {
		this.orgCode = value;
	}

	public Long getPartyId() {
		return this.partyId;
	}
	
	public void setPartyId(Long value) {
		this.partyId = value;
	}

	public String getOrgName() {
		return this.orgName;
	}
	
	public void setOrgName(String value) {
		this.orgName = value;
	}

	public Long getParentId() {
		return this.parentId;
	}
	
	public void setParentId(Long value) {
		this.parentId = value;
	}

	public Long getSortno() {
		return this.sortno;
	}
	
	public void setSortno(Long value) {
		this.sortno = value;
	}

	public Long getLeaf() {
		return this.leaf;
	}
	
	public void setLeaf(Long value) {
		this.leaf = value;
	}

	public Long getLeafNum() {
		return this.leafNum;
	}
	
	public void setLeafNum(Long value) {
		this.leafNum = value;
	}

	public Long getState() {
		return this.state;
	}
	
	public void setState(Long value) {
		this.state = value;
	}

	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}

	public java.util.Date getUpdateTime() {
		return this.updateTime;
	}
	
	public void setUpdateTime(java.util.Date value) {
		this.updateTime = value;
	}

	public Long getVersion() {
		return this.version;
	}
	
	public void setVersion(Long value) {
		this.version = value;
	}


	
	public UserOrg() {
	}
	
	public UserOrg(boolean qryflag) {
	    if(qryflag){
	    		this.orgId = null;
				this.orgCode = null;
				this.partyId = null;
				this.orgName = null;
				this.parentId = null;
				this.sortno = null;
				this.leaf = null;
				this.leafNum = null;
				this.state = null;
				this.createTime = null;
				this.updateTime = null;
				this.version = null;
			    }
	}


	public UserOrg(
	    Long inOrgId,
	    String inOrgCode,
	    Long inPartyId,
	    String inOrgName,
	    Long inParentId,
	    Long inSortno,
	    Long inLeaf,
	    Long inLeafNum,
	    Long inState,
	    java.util.Date inCreateTime,
	    java.util.Date inUpdateTime,
		Long inVersion
	 ) {
		super();
				this.orgId = inOrgId;
				this.orgCode = inOrgCode;
				this.partyId = inPartyId;
				this.orgName = inOrgName;
				this.parentId = inParentId;
				this.sortno = inSortno;
				this.leaf = inLeaf;
				this.leafNum = inLeafNum;
				this.state = inState;
				this.createTime = inCreateTime;
				this.updateTime = inUpdateTime;
				this.version = inVersion;
			}

	@Transient
	private String parentName ="";

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}
}

